﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Classwork03
{
    abstract class Graph
    {
        protected string shape;//图形类型参数
        private double length;//图形大小参数

        public Graph(string _shape)
        {
            shape = _shape;
        }

        public abstract double CalculateArea();//计算面积

        public abstract bool IsLegal();//判断合法性

        public override string ToString()
        {
            return shape + " area = " + CalculateArea();
        }
    }
}
